﻿@using Mulala.Cavan.Presentation.Seedwork
@using Mulala.Cavan.Presentation.Mvc.Controller
@using Mulala.Cavan.Domain.MainBoundedContext.DictionaryModule
@model INannyViewModel
@{
    ViewBag.Title = "个人信息";
    Layout = "~/Views/Shared/_NannyCenterLayout.cshtml";
}
@section header{
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/themes/corporationcenter")
    @Styles.Render("~/Content/themes/nannycenter/info")
}
<div id="main">
    <div class="maintoptext">
        基本信息编辑</div>
    <div id="divconte">
        <div id="divyou">
            友情提示：<p>
                1、为了方便家政人员与业主的沟通，请如实填写个人信息</p>
            <p>
                2、真实姓名一旦保存，将不能再修改</p>
        </div>
        <p class="bitan">
            必&nbsp;&nbsp;&nbsp;填&nbsp;&nbsp;&nbsp;项：</p>
    </div>
    @using (Html.BeginForm())
    {
        <div class="jiben2">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="29%" align="right">
                        姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：
                    </td>
                    <td width="71%" align="left">
                        @Html.TextBoxFor(m => m.Item.Name, new { id = "Name", @class = "gsmin" })
                        @Html.HiddenFor(m => m.Item.ID, new { id = "NannyID" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.SexForEdit, DictionaryIdentifier.GroupType.NannySex, new { id = "Sex", @class = "qyxz" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Age, DictionaryIdentifier.GroupType.NannyAge, new { id = "Age", @class = "qyxz" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区：
                    </td>
                    <td align="left">
                        @Html.Action("selectarea", "area", new { cityID = @Model.CityID, townID = @Model.TownID })
                        @Html.HiddenFor(m => m.Item.Area.ID, new { id = "Area" })
                        @Html.ValidationMessageFor(m => m.Item.Area)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Address, new { id = "Address", @class = "gsmin" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        出生日期：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Birthday, new { id = "Birthday", @class = "qtatext" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Telephone, new { id = "Telephone", @class = "qtatext" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Mobile, new { id = "Mobile", @class = "qtatext" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        是否已婚：
                    </td>
                    <td align="left">
                        @Html.CheckBoxFor(m => m.Item.IsMarried, new { id = "IsMarried" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        是否有小孩：
                    </td>
                    <td align="left">
                        @Html.CheckBoxFor(m => m.Item.HasChildren, new { id = "HasChildren" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;历：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Degree, DictionaryIdentifier.GroupType.NannyDegree, new { id = "Degree", @class = "qyxz" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        工作经验：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Experience, DictionaryIdentifier.GroupType.NannyExperience, new { id = "Experience", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        擅长技能：
                    </td>
                    <td align="left">
                        @Html.CheckBoxListFor(m => m.MainSkills, DictionaryIdentifier.GroupType.NannySkill, System.Web.UI.WebControls.RepeatDirection.Horizontal)
                        @Html.HiddenFor(m => m.MainSkill, new { id = "MainSkill" }) &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        语&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;言：
                    </td>
                    <td align="left">
                        @Html.CheckBoxListFor(m => m.Languages, DictionaryIdentifier.GroupType.NannyLanguage, System.Web.UI.WebControls.RepeatDirection.Horizontal)
                        @Html.HiddenFor(m => m.Language, new { id = "Language" }) &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        资格证书：
                    </td>
                    <td align="left">
                        @Html.CheckBoxListFor(m => m.Certificates, DictionaryIdentifier.GroupType.NannyCertificate, System.Web.UI.WebControls.RepeatDirection.Horizontal)
                        @Html.HiddenFor(m => m.Certificate, new { id = "Certificate" }) &nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        薪资要求：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Salary, DictionaryIdentifier.GroupType.NannySalary, new { id = "Salary" })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        个人介绍：
                    </td>
                    <td align="left">
                        @Html.TextAreaFor(m => m.Item.Introduce, new { id = "Introduce", cols = "55", rows = "8", onfocus = Html.Raw("if(value=='输入文字...') {value=''}"), onblur = Html.Raw("if(value=='') {value='输入文字...'") })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        个人宣言：
                    </td>
                    <td align="left">
                        @Html.TextAreaFor(m => m.Item.Declaration, new { id = "Declaration", cols = "55", rows = "8", onfocus = Html.Raw("if(value=='输入文字...') {value=''}"), onblur = Html.Raw("if(value=='') {value='输入文字...'") })
                        &nbsp;&nbsp;<span class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        家政类型：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.TypeForEdit, DictionaryIdentifier.GroupType.NannyType, new { id = "Type", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
            </table>
            <p class="bitan">
                选&nbsp;&nbsp;&nbsp;填&nbsp;&nbsp;&nbsp;项：</p>
        </div>
        <div class="jiben2">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="29%" align="right">
                        名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族：
                    </td>
                    <td width="71%" align="left">
                        @Html.DropDownListFor(m => m.Item.Nation, DictionaryIdentifier.GroupType.NannyNation, new { id = "Nation", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        Q&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.QQ, new { id = "QQ", @class = "qtatext" })
                        &nbsp;&nbsp;<span class="tstext"> </span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        MSN：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.MSN, new { id = "MSN", @class = "qtatext" })&nbsp;&nbsp;<span
                            class="tstext"> </span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        星&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;座：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Astrology, DictionaryIdentifier.GroupType.NannyAstrology, new { id = "NannyAstrology", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"> </span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        属&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;相：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.ChineseZodiac, DictionaryIdentifier.GroupType.NannyChineseZodiac, new { id = "ChineseZodiac", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"> </span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        宗&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;教：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Faith, DictionaryIdentifier.GroupType.NannyFaith, new { id = "Faith", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        培训经历：
                    </td>
                    <td align="left">
                        @Html.CheckBoxFor(m => m.Item.IsTrained, new { id = "IsTrained" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        计算机水平：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.ComputerLevel, DictionaryIdentifier.GroupType.NannyComputerLevel, new { id = "ComputerLevel", @class = "qyxz" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        驾驶能力：
                    </td>
                    <td align="left">
                        @Html.CheckBoxFor(m => m.Item.CanDrive, new { id = "CanDrive" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        需住宿：
                    </td>
                    <td align="left">
                        @Html.CheckBoxFor(m => m.Item.IsNeedAccommodate, new { id = "IsNeedAccommodate" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        需工作餐：
                    </td>
                    <td align="left">
                        @Html.CheckBoxFor(m => m.Item.IsNeedMeal, new { id = "IsNeedMeal" })&nbsp;&nbsp;<span
                            class="tstext"></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;
                    </td>
                    <td align="left">
                        <input type="submit" id="submit" value=" " class="submits" />
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <br />
    }
</div>
<div id="rights">
    <div id="righttop">
        @{
            Html.RenderAction(ActionConst.PARTINFO, ControllerConst.NANNYCENTER);
        }
    </div>
    <div id="divs">
        @{
            Html.RenderAction(ActionConst.POPULARPROPRIETOR, ControllerConst.PROPRIETOR);
        }
    </div>
</div>
@section scripts{
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/edit")
    @Scripts.Render("~/bundles/datepicker")
    <script type="text/javascript">
        $(function () {
            $("form[action$='info']").submit(function () {
                $.ajax({
                    url: this.action,
                    type: this.method,
                    data: $(this).serialize(),
                    success: function (data) {
                        if (data) {
                            alert(data.Messages[0]);
                        }
                    },
                    error: function () {
                        alert('ok');
                    }
                })

                return false;
            });

            $("input[name='MainSkills']").click(function () {
                var mainSkill = "";
                $("input[name='MainSkills']").each(function () {
                    if ($(this).attr("checked") == "checked") {
                        mainSkill = mainSkill + $(this).val() + ',';
                    }
                })
                $("#MainSkill").val(mainSkill);
            });

            $("input[name='Certificates']").click(function () {
                var certificate = "";
                $("input[name='Certificates']").each(function () {
                    if ($(this).attr("checked") == "checked") {
                        certificate = certificate + $(this).val() + ',';
                    }
                })
                $("#Certificate").val(certificate);
            });

            $("input[name='Languages']").click(function () {
                var language = "";
                $("input[name='Languages']").each(function () {
                    if ($(this).attr("checked") == "checked") {
                        language = language + $(this).val() + ',';
                    }
                })
                $("#Language").val(language);
            });

            function ShowDatePicker() {
                WdatePicker({ maxDate: new Date() });
            }
            $("#Birthday").click(ShowDatePicker).focus(ShowDatePicker);
        })
    </script>
}
